/*    */ package org.apache.mina.filter.ssl;
/*    */ 
/*    */ import javax.net.ssl.SSLContext;
/*    */ import org.apache.mina.core.session.AttributeKey;
/*    */ import org.apache.mina.core.session.IoSession;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class ZimbraSslFilter
/*    */   extends SslFilter
/*    */ {
/* 27 */   private static final AttributeKey SSL_HANDLER_KEY = new AttributeKey(SslFilter.class, "handler");
/*    */   
/*    */   public ZimbraSslFilter(SSLContext sslContext) {
/* 30 */     super(sslContext);
/*    */   }
/*    */   
/*    */   public boolean isSslHandshakeComplete(IoSession session) {
/* 34 */     SslHandler handler = getSslSessionHandler(session);
/* 35 */     return (handler != null) && (handler.isHandshakeComplete());
/*    */   }
/*    */   
/*    */   private SslHandler getSslSessionHandler(IoSession session) {
/* 39 */     SslHandler handler = (SslHandler)session.getAttribute(SSL_HANDLER_KEY);
/*    */     
/* 41 */     if (handler == null) {
/* 42 */       throw new IllegalStateException();
/*    */     }
/*    */     
/* 45 */     if (handler.getSslFilter() != this) {
/* 46 */       throw new IllegalArgumentException("Not managed by this filter.");
/*    */     }
/*    */     
/* 49 */     return handler;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/org/apache/mina/filter/ssl/ZimbraSslFilter.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */